﻿package 
{
	import flash.display.Bitmap;
	import flash.display.BitmapData;
	import flash.display.MovieClip;
	import flash.events.Event;
	import flash.events.MouseEvent;
	import flash.display.Sprite;
	import nid.events.CalendarEvent;
	import nid.ui.controls.DatePicker;
	
	/**
	 * ...
	 * @author Nidin Vinayak
	 */
	public class Main extends Sprite
	{
		
		//[Embed(source = "../asset/1265538087_calendar_day.png")]
			//private var icon:Class;
		
		//[Embed(source = "../asset/tahoma.ttf", fontWeight= "normal", fontFamily = "Tahoma")]
			//protected static var Tahoma:Class;
		
	//	[Embed(source = "../asset/tahomaBold.ttf",  fontWeight= "bold", fontFamily = "Tahoma")]
			//protected static var TahomaBold:Class;
		
		public function Main():void{
			if (stage) init();
			else addEventListener(Event.ADDED_TO_STAGE, init);
		}
		
		private function init(e:Event = null):void {
			removeEventListener(Event.ADDED_TO_STAGE, init);
			// entry point
			var datePicker:DatePicker = new DatePicker();
			//dateChooser.icon = new icon();
			datePicker.embedFonts = false;
			datePicker.font = "Tahoma";			
			datePicker.WeekStart = "sunday";
			addChild(datePicker);
			datePicker.addEventListener(CalendarEvent.CHANGE, getdate);
			datePicker.x = 25;
			datePicker.y = 25;
		}
		private function getdate(e:CalendarEvent):void {
			trace("Date:" + e.selectedDate);
		}
		
	}
	
}